home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7585 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.3 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
  4. Subject: Re: Access carry flag from C
  5. Date: 23 Feb 1996 17:15:10 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Feb23101510@qcd.lanl.gov>
  8. References: <Dn1C9z.DGv.0.net@indra.com> <1996Feb1922.17.19.879@koobera.math.uic.edu>
  9.     <31298D20.41C6@bazis.nl> <danpop.824859220@rscernix>
  10.     <312AFACE.41C6@bazis.nl> <TANMOY.96Feb21081640@qcd.lanl.gov>
  11.     <312D8414.167E@bazis.nl>
  12. NNTP-Posting-Host: qcd.lanl.gov
  13. Mime-Version: 1.0
  14. Content-Type: text
  15. In-reply-to: Franz Korntner's message of Fri, 23 Feb 1996 09:08:36 GMT
  16.  
  17. <snip>
  18. FK: Tanmoy Bhattacharya wrote:
  19. FK: > 
  20. FK: > In article <312AFACE.41C6@bazis.nl> Franz Korntner <fkorntne@bazis.nl>
  21. FK: > writes:
  22. FK: > <snip>
  23. FK: >    32 bit numbers. According to the (X3J11 / ANSI) standard, the constant
  24. FK: >    INT_MAX (and in this case most limits in limits.h) denotes the minimal
  25. FK: >    limit. It is possible that the physical limit is much higher (or lower
  26. FK: >    in the case of negative values). As I am only interested in the physical
  27. FK: >    limit, the value INT_MAX has no meaning. Only the compiler is fully aware
  28. FK: >    of these limits (and not a header file!) and what I really miss in the
  29. FK: >    standard and/or implementation is a inline function 'maxlimitof(int)',
  30. FK: >    analogical to 'sizeof(int)'.
  31. FK: > 
  32. FK: > Please quote the standard. I find no discussion of this in my copy;
  33. FK: > and I suspect it is incorrect.
  34. FK: 
  35. FK: I only have a copy of the Rationale at this moment, and it is also
  36. mentioned 
  37. FK: on page 17, Environmental limits.
  38. FK: 
  39. FK: 2.2.4.2.1 Sizes of integral types <limits.h>. Such a large body of C code
  40. FK: has been developed for the 8-bit byte machines that the integer sizes in
  41. FK: such environments must be considered normative. The prescribed limits are
  42. FK: minima; an implementation on a machine with 9-bit bytes can be conforming,
  43. FK: as can an implementation that defines int to be the same width as long.
  44. FK: page 17.
  45.  
  46. I don't understand what you are saying! Have you read the clause?
  47.  
  48.     5.2.4.2 (your 2.2.4.2):
  49.  
  50.     A conforming implementation shall document all the limits specified in
  51.     this subclause.
  52.  
  53.     5.2.4.2.1:
  54.  
  55.     The values given below shall be replaced by constant expressions
  56.     ... Their implementation-defined values shall be greater in magnitude
  57.     (absolute value) to those shown, with the same sign.
  58.  
  59.     ...
  60.     --- maximum value for an object of type int
  61.     INT_MAX   +32767
  62.  
  63. Is there any doubt as to what this means? The only interpretation I
  64. can think of is that INT_MAX is the maximum value of type int, this
  65. has to be defined by the implementation, the definition is to be a
  66. constant, and this constant has to exceed 32767. 
  67.  
  68. It states explicitly that INT_MAX is the maximum value of type int
  69. ... how do you read anything else?
  70.  
  71. Cheers
  72. Tanmoy
  73. --
  74. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  75. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  76. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  77. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  78. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  79. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  80.